package oceanlife;
import java.util.ArrayList;
import java.util.HashMap;

import javax.swing.JPanel;

import oceanlife.pathfinding.Obstacles;
import oceanlife.pathfinding.Pnt;
import oceanlife.pathfinding.SimpleObstacle;



public class AgentGenerator {

	public ArrayList<Agent> generateAgents(int agentsAmount, Pnt[] spawnBox, Pnt goal, int colorCode, RandomGen randAgInit) {
		ArrayList<Agent> agents = new ArrayList<Agent>();
		for(int i = 0; i < agentsAmount; i++){
			//System.out.println("agent:"+i);
			Agent agent = null;
			agent = new Agent(agents,spawnBox,randAgInit);
			agent.setColor(colorCode);
			/*boolean Collission = true;
			while(Collission){
				agent = new Agent(agents,spawnBox);
				//System.out.println("try"+agent.getPosition());
				Collission = false;
				for(Agent ag : agents){
					if(ag.getPosition().distanceTo(agent.getPosition()) < 2*ag.getRadius()){
						Collission = true;
						break;
					}
				}
			}*/
			//System.out.println("goed: "+agent.getPosition().coord(0)+"/"+agent.getPosition().coord(1));
			agent.setGoal(goal);
			agents.add(agent);
			//System.out.println(agents.get(i).getX_coord()+" "+agents.get(i).getY_coord());
		}
		return agents;
	}


}
